import VueRouter from 'vue-router'
import Vue from 'vue'
import diary from "@/admin/diary.vue";
import belongings from "@/admin/belongings.vue";
Vue.use(VueRouter)


const router = new VueRouter({
    routes: [
        {
            path: '/', redirect: '/login'
        },
        { path: '/login',  component: () => import('@/student/loginPage.vue') },
        {
            path: '/studentPage',  component: () => import('@/student/indexPage.vue'),
            children: [
                { path: '/studentPage', redirect: '/studentPage/studentHome' },
                { path: '/studentPage/studentHome',  component: () => import('@/student/studentHome.vue') },
                { path: '/studentPage/feeManagement', component: () => import('@/student/feeManagement.vue')},
                { path: '/studentPage/applyRepair', component: () => import('@/student/applyRepair.vue')},
            ]
        },
        { path: '/adminLogin',  component: () => import('@/admin/loginPage.vue') },
        {
            path: '/adminPage',  component: () => import('@/admin/indexPage.vue'),
            children: [
                { path: '/adminPage', redirect: '/adminPage/studentInfo' },
                { path: '/adminPage/studentInfo', component: () => import('@/admin/studentInfo.vue')},
                { path: '/adminPage/assignDorm', component: () => import('@/admin/assignDorm.vue')},

                { path: '/indexPage/diary', component: diary },
                { path: '/indexPage/belongings', component: belongings },
            ]
        },
        { path: '/workerPage', redirect: '/workerPage/repairManagement' },
        { path: '/workerPage/repairManagement', component: () => import('@/worker/repairManagement.vue')},
        { path: '/workerLogin', component: () => import('@/worker/workerLogin.vue')},
    ]
})


export default router